package ru.spb.nicetu.altx.mnemo.utils.collections;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionsUtils {
  public static <E> Collection<E> filter(Collection<E> elements, ITargetComparator<E> cmpr) {
    Collection<E> result = new ArrayList<E>();
    for (E e : elements)
      if (cmpr.isTarget(e))
        result.add(e);
    return result;
  }

}
